fix: eliminate string literal duplications in PlantUML mapping#33
fix: eliminate string literal duplications in PlantUML mapping#33sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZZjJgtKOPkSvG45yHzz for python:S1192 rule - AZZjJgtKOPkSvG45yHzy for python:S1192 rule Generated by SonarQube Agent (task: d6a18938-c725-4590-b619-be401fd2d201)
|
|
|
|




Resolves two SonarQube critical issues by extracting repeated string literals into constants. Defines EXTENSION_EXTENSION_PREFIX and PLANTUML_AS constants to replace 4 and 9 duplicate occurrences respectively, improving code maintainability and reducing the risk of inconsistent string values.
View Project in SonarCloud
Fixed Issues
python:S1192 - Define a constant instead of duplicating this literal 'Extension.extension:' 4 times. • CRITICAL • View issue
Location:
PlantUML/construct_mappings.py:109Why is this an issue?
Duplicated string literals make the process of refactoring complex and error-prone, as any change would need to be propagated on all occurrences.
What changed
Defines the constant EXTENSION_EXTENSION_PREFIX = 'Extension.extension:' to replace the duplicated string literal 'Extension.extension:' that appeared 4 times throughout the code. This constant is then used by other hunks to eliminate the duplication.
python:S1192 - Define a constant instead of duplicating this literal '" as ' 9 times. • CRITICAL • View issue
Location:
PlantUML/construct_mappings.py:313Why is this an issue?
Duplicated string literals make the process of refactoring complex and error-prone, as any change would need to be propagated on all occurrences.
What changed
Defines the constant PLANTUML_AS = '" as ' to replace the duplicated string literal '" as ' that appeared 9 times in the PlantUML generation code. This constant is then used by subsequent hunks to eliminate the duplication.
SonarQube Remediation Agent uses AI. Check for mistakes.